Passing a column as a function parameter that creates a table